//========encoding:utf-8=========
/*
 * @describe:  
 * @author:cjgong
 * @copyright:chinasoft.cn
 * @date:2020年1月16日 下午3:53:54 
 */

package edu.chinasoft.service;

import org.apache.log4j.Logger;

import edu.chinasoft.dao.GoodsDao;
import edu.chinasoft.dao.GoodsDaoImp;
import edu.chinasoft.pojo.Goods;
import edu.chinasoft.pojo.PageUtilForGoods;

public class GoodsServiceImp implements GoodsService {
	private Logger logger = Logger.getLogger(GoodsServiceImp.class);
	private GoodsDao goodsDao=new GoodsDaoImp();
	
	/* (non-Javadoc)
	 * @see edu.chinasoft.service.GoodsService#addGoods(edu.chinasoft.pojo.Goods)
	 */
	@Override
	public boolean addGoods(Goods goods) {
		logger.debug("GoodsServiceImp>>>addGoods  start ……");
		boolean result = goodsDao.insertTable(goods);
		logger.debug("GoodsServiceImp>>>addGoods  end ……");
		return result;
	}
    @Override
	public PageUtilForGoods findGoods(int currentPage, int pageUtil) {
		logger.debug("GoodsServiceImp>>>findGoods  start ……");
		PageUtilForGoods result = goodsDao.selectTablePage(currentPage, pageUtil);
		
		logger.debug("GoodsServiceImp>>>findGoods  end ……");
		return result;
	}
    @Override
    public Goods  findGoodsInfo(Goods goods) {
    	logger.debug("GoodsServiceImp>>>findGoodsInfo  start ……");
    	Goods result = this.goodsDao.selectGoodsById(goods);
    	logger.debug("GoodsServiceImp>>>findGoodsInfo  end ……");
    	return result;
    }
	
}
